// 下拉菜单
var aH6 = document.querySelectorAll("#nav h4");
var aUl = document.querySelectorAll("#nav ul");
for (var i = 0; i < aH6.length; i++) {
  aH6[i].onclick = function () {
    var oUl = this.nextElementSibling;
    if (getComputedStyle(oUl).height == "0px") {
      //先对所有#nav里面的ul设置高度为0px，相当于清空样式（这样点开那个显示那个）
      for (var i = 0; i < aUl.length; i++) {
        aUl[i].style.height = "0px";
      }
      //ul的高度 = ul第一个孩子节点li的高度 * 所有li的长度
      oUl.style.height =
        oUl.children[0].offsetHeight * oUl.children.length + "px"; //offsetHeight获取的是占位大小：内容+padding+border
    } else {
      oUl.style.height = "0px";
    }
  };
}

//导航窗口切换
var aNavLabel = document.querySelectorAll(".navLabel");
var aWindowShow = document.querySelectorAll(".windowShow");
for (var i = 0; i < aNavLabel.length; i++) {
  aNavLabel[i].index = i;
  aNavLabel[i].onclick = function () {
    for (var i = 0; i < aNavLabel.length; i++) {
      aNavLabel[i].classList.remove("active1");
      aWindowShow[i].classList.remove("active2");
    }
    this.classList.add("active1");
    aWindowShow[this.index].classList.add("active2");
  };
}

/*心血管系统用药
1-1
钙通道阻滞用药
慢性心功能不全
抗心律失常药
2
呼吸系统用药
2-1
镇咳药
祛痰药
平喘药
3
皮肤科用药
止痒药
消炎药
过敏药
*/

var data = [
  {
    id: 1,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "checked",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "钙通道阻滞用药", //二级分类
    status: "审核通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "不显示",
    remarks: "备注内容1",
  },
  {
    id: 2,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*10片/盒", //规格
    price: 35,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "checked",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "慢性心功能不全", //二级分类
    status: "审核通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容2",
  },
  {
    id: 3,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*20片/盒", //规格
    price: 45,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "disabled",
    stock: 90, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "抗心律失常药", //二级分类
    status: "审核未通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容3",
  },
  {
    id: 4,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "6mg*7片/盒", //规格
    price: 21,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "呼吸系统用药", //一级分类
    drugClassification2: "镇咳药", //二级分类
    status: "审核通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容4",
  },
  {
    id: 5,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "checked",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "呼吸系统用药", //一级分类
    drugClassification2: "祛痰药", //二级分类
    status: "审核通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容5",
  },
  {
    id: 6,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "disabled",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "呼吸系统用药", //一级分类
    drugClassification2: "平喘药", //二级分类
    status: "审核未通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容6",
  },
  {
    id: 7,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "皮肤科用药", //一级分类
    drugClassification2: "止痒药", //二级分类
    status: "审核通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容7",
  },
  {
    id: 8,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "10mg*20片/盒", //规格
    price: 55,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "disabled",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "皮肤科用药", //一级分类
    drugClassification2: "过敏药 ", //二级分类
    status: "审核未通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容8",
  },
  {
    id: 9,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*5片/盒", //规格
    price: 15,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "钙通道阻滞用药", //二级分类
    status: "审核通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容9",
  },
  {
    id: 10,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "disabled",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "钙通道阻滞用药", //二级分类
    status: "审核未通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容10",
  },
  {
    id: 11,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "checked",
    stock: 22, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "抗心律失常药",
    status: "审核通过",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容11",
  },
  {
    id: 12,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "checked",
    stock: 32, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "钙通道阻滞用药", //二级分类
    status: "审核通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容12",
  },
  {
    id: 13,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "disabled",
    stock: 55, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "抗心律失常药", //二级分类
    status: "审核未通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容13",
  },
  {
    id: 14,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 20,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "checked",
    stock: 77, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "慢性心功能不全", //二级分类
    status: "审核通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容14",
  },
  {
    id: 15,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "disabled",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "钙通道阻滞用药", //二级分类
    status: "审核未通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容15",
  },
  {
    id: 16,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "checked",
    stock: 120, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "慢性心功能不全", //二级分类
    status: "审核通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容16",
  },
  {
    id: 17,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "disabled",
    stock: 110, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "抗心律失常药", //二级分类
    status: "审核未通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容17",
  },
  {
    id: 18,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "checked",
    stock: 34, //库存
    prescription: "是", //处方药
    drugClassification1: "呼吸系统用药", //一级分类
    drugClassification2: "祛痰药", //二级分类
    status: "审核通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容18",
  },
  {
    id: 19,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "checked",
    stock: 66, //库存
    prescription: "是", //处方药
    drugClassification1: "皮肤科用药", //一级分类
    drugClassification2: "消炎药", //二级分类
    status: "审核通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容19",
  },
  {
    id: 20,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "disabled",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "抗心律失常药", //二级分类
    status: "审核未通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容20",
  },
  {
    id: 21,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "disabled",
    stock: 12, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "慢性心功能不全", //二级分类
    status: "审核未通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容21",
  },
  {
    id: 22,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "钙通道阻滞用药", //二级分类
    status: "审核通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容22",
  },
  {
    id: 23,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "checked",
    stock: 90, //库存
    prescription: "是", //处方药
    drugClassification1: "呼吸系统用药", //一级分类
    drugClassification2: "镇咳药", //二级分类
    status: "审核通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容23",
  },
  {
    id: 24,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "checked",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "呼吸系统用药", //一级分类
    drugClassification2: "祛痰药", //二级分类
    status: "审核通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容24",
  },
  {
    id: 25,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "disabled",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "呼吸系统用药", //一级分类
    drugClassification2: "平喘药", //二级分类
    status: "审核未通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容25",
  },
  {
    id: 26,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "",
    stock: 65, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "抗心律失常药", //二级分类
    status: "审核通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容26",
  },
  {
    id: 27,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "disabled",
    stock: 80, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "钙通道阻滞用药", //二级分类
    status: "审核未通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容27",
  },
  {
    id: 28,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 35,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "慢性心功能不全", //二级分类
    status: "审核通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容28",
  },
  {
    id: 29,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "disabled",
    stock: 112, //库存
    prescription: "是", //处方药
    drugClassification1: "皮肤科用药", //一级分类
    drugClassification2: "过敏药 ", //二级分类
    status: "审核未通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容29",
  },
  {
    id: 30,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "checked",
    stock: 45, //库存
    prescription: "是", //处方药
    drugClassification1: "皮肤科用药", //一级分类
    drugClassification2: "消炎药", //二级分类
    status: "审核通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容30",
  },
  {
    id: 31,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "disabled",
    stock: 65, //库存
    prescription: "是", //处方药
    drugClassification1: "皮肤科用药", //一级分类
    drugClassification2: "止痒药", //二级分类
    status: "审核未通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容31",
  },
  {
    id: 32,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "disabled",
    stock: 87, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "钙通道阻滞用药", //二级分类
    status: "审核未通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容32",
  },
  {
    id: 33,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "",
    stock: 124, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "慢性心功能不全", //二级分类
    status: "审核通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容33",
  },
  {
    id: 34,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "disabled",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "抗心律失常药", //二级分类
    status: "审核未通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容34",
  },
  {
    id: 35,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "",
    stock: 64, //库存
    prescription: "是", //处方药
    drugClassification1: "呼吸系统用药", //一级分类
    drugClassification2: "平喘药", //二级分类
    status: "审核通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容35",
  },
  {
    id: 36,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "disabled",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "呼吸系统用药", //一级分类
    drugClassification2: "祛痰药", //二级分类
    status: "审核未通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容36",
  },
  {
    id: 37,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "disabled",
    stock: 76, //库存
    prescription: "是", //处方药
    drugClassification1: "呼吸系统用药", //一级分类
    drugClassification2: "平喘药", //二级分类
    status: "审核未通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容37",
  },
  {
    id: 38,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "disabled",
    stock: 42, //库存
    prescription: "是", //处方药
    drugClassification1: "呼吸系统用药", //一级分类
    drugClassification2: "祛痰药", //二级分类
    status: "审核未通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容38",
  },
  {
    id: 39,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "",
    stock: 46, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "抗心律失常药", //二级分类
    status: "审核通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容39",
  },
  {
    id: 40,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "disabled",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "慢性心功能不全", //二级分类
    status: "审核未通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容40",
  },
  {
    id: 41,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "disabled",
    stock: 42, //库存
    prescription: "是", //处方药
    drugClassification1: "皮肤科用药", //一级分类
    drugClassification2: "止痒药", //二级分类
    status: "审核未通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容41",
  },
  {
    id: 42,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "checked",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "钙通道阻滞用药", //二级分类
    status: "审核通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容42",
  },
  {
    id: 43,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "disabled",
    stock: 67, //库存
    prescription: "是", //处方药
    drugClassification1: "皮肤科用药", //一级分类
    drugClassification2: "过敏药 ", //二级分类
    status: "审核未通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容43",
  },
  {
    id: 44,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "皮肤科用药", //一级分类
    drugClassification2: "消炎药", //二级分类
    status: "审核通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容44",
  },
  {
    id: 45,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "disabled",
    stock: 84, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "钙通道阻滞用药", //二级分类
    status: "审核未通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容45",
  },
  {
    id: 46,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "checked",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "镇咳药", //一级分类
    drugClassification2: "平喘药", //二级分类
    status: "审核通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容46",
  },
  {
    id: 47,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "disabled",
    stock: 99, //库存
    prescription: "是", //处方药
    drugClassification1: "呼吸系统用药", //一级分类
    drugClassification2: "祛痰药", //二级分类
    status: "审核未通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容47",
  },
  {
    id: 48,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "disabled",
    stock: 33, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "慢性心功能不全", //二级分类
    status: "审核未通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容48",
  },
  {
    id: 49,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "",
    stock: 26, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "抗心律失常药", //二级分类
    status: "审核通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容49",
  },
  {
    id: 50,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "disabled",
    stock: 53, //库存
    prescription: "是", //处方药
    drugClassification1: "皮肤科用药", //一级分类
    drugClassification2: "止痒药", //二级分类
    status: "审核未通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容50",
  },
  {
    id: 51,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "哈药集团", //药企
    sell: "checked",
    stock: 40, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "抗心律失常药", //二级分类
    status: "审核通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容51",
  },
  {
    id: 52,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "disabled",
    stock: 20, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "慢性心功能不全", //二级分类
    status: "审核未通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容52",
  },
  {
    id: 53,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "哈药集团", //药企
    sell: "checked",
    stock: 75, //库存
    prescription: "是", //处方药
    drugClassification1: "呼吸系统用药", //一级分类
    drugClassification2: "平喘药", //二级分类
    status: "审核通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容53",
  },
  {
    id: 54,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "",
    stock: 34, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "钙通道阻滞用药", //二级分类
    status: "审核通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容54",
  },
  {
    id: 55,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "哈药集团", //药企
    sell: "disabled",
    stock: 55, //库存
    prescription: "是", //处方药
    drugClassification1: "呼吸系统用药", //一级分类
    drugClassification2: "镇咳药", //二级分类
    status: "审核未通过", //审核状态
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容55",
  },
];
//当前页码
var page = 1;
//每页数据条数
var count = 10;
//获取tbody
var oTbody = document.querySelector("tbody");
//获取分页容器
var oPagination = document.querySelector(".pagination");
//获取上一页的按钮
var oPrevBtn = document.querySelector(".prev");
//获取下一页的按钮
var oNextBtn = document.querySelector(".next");
//获取页脚容器
var oFooterBox = document.querySelector(".footerBox");
//获取批量删除按钮
var oDelAll = document.querySelector(".delAll");
//获取全选按钮
var oSelAll = document.querySelector(".selectAll");
var n = 0;
//获取筛选输入框按钮
var oSearchInp = document.querySelector(".searchInp");
//获取筛选框1按钮
var oSelect1 = document.querySelector("#select1");
//获取筛选框2按钮
var oSelect2 = document.querySelector("#select2");
//获取搜索按钮
var oSearchBtn = document.querySelector(".selectBtn");
//获取药品管理界面新增按钮
var oAddBtn = document.querySelector(".addBtn");
//获取药品管理界面
var oDrugManagement = document.querySelector(".drugManagement");
//获取新增页面
var oNewDrugs = document.querySelector(".newDrugs");
//获取审核通过、未通过按钮
var oDrugsStatusSuccess = document.querySelector(".drugsStatus-success");
var oDrugsStatusFailed = document.querySelector(".drugsStatus-failed");
//获取审核通过的Tbody
var oStatusSuccessTbody = document.querySelector(".statusSuccessTbody");
//获取未审核通过的Tbody
var oStatusFailedTbody = document.querySelector(".statusFailedTbody");
//获取编辑页面
var oEditDrugs = document.querySelector(".editDrugs");
//获取编辑内容
var oEditContext = document.querySelector(".editDrugs-context");
//获取分类标签按钮
var aDataLabel = document.querySelectorAll(".dataLabel");
var oDataTitle = document.querySelector(".data-list-context-title");

//数据分类标签(全部、已上架、未上架、审核未通过)
for (var i = 0; i < aDataLabel.length; i++) {
  aDataLabel[i].onclick = function () {
    page = 1;
    for (var i = 0; i < aDataLabel.length; i++) {
      aDataLabel[i].classList.remove("dataActive");
    }
    this.classList.add("dataActive");
    render();
    oSelAll.value = false;
    n = 0;
  };
}

//页面初始化渲染
function render() {
  var dataOutArr = [];
  for (var i = 0; i < aDataLabel.length; i++) {
    if (aDataLabel[i].className.includes("dataActive")) {
      switch (aDataLabel[i].innerHTML) {
        case "全部":
          dataOutArr = data;
          break;
        case "已上架":
          for (var i = 0; i < data.length; i++) {
            if (data[i].sell.trim() == "checked") {
              dataOutArr.push(data[i]);
            }
          }
          break;
        case "未上架":
          for (var i = 0; i < data.length; i++) {
            if (data[i].sell.trim() == "") {
              dataOutArr.push(data[i]);
            }
          }
          break;
        case "审核未通过":
          for (var i = 0; i < data.length; i++) {
            if (data[i].status.trim() == "审核未通过") {
              dataOutArr.push(data[i]);
            }
          }
          break;
      }
    }
  }
  var str1 = oSearchInp.value;
  var str2 = oSelect1.value;
  var str3 = oSelect2.value;
  var data1 = [];
  var data2 = [];
  var searchData = [];

  //判断第一个条件搜索
  if (str1.trim() == "") {
    data1 = dataOutArr;
  } else {
    for (var i = 0; i < data.length; i++) {
      if (data[i].drugCompanies.includes(str1)) {
        data1.push(data[i]);
      }
    }
  }
  //判断第二个条件搜索
  if (str2.trim() == "请选择分类") {
    data2 = data1;
  } else {
    for (var i = 0; i < data1.length; i++) {
      if (data1[i].drugClassification1.includes(str2)) {
        data2.push(data1[i]);
      }
    }
  }
  //判断第三个条件搜索
  if (str3.trim() == "请选择分类") {
    searchData = data2;
  } else {
    for (var i = 0; i < data2.length; i++) {
      if (data2[i].drugClassification2.includes(str3)) {
        searchData.push(data2[i]);
      }
    }
  }
  //让tbody为空
  oTbody.innerHTML = "";
  //根据count和page渲染数据
  var renderArr = searchData.slice((page - 1) * count, page * count);
  //循环要渲染的数据
  for (var i = 0; i < renderArr.length; i++) {
    //创建tr
    var oTr = document.createElement("tr");
    //给创建内容
    oTr.innerHTML = `<td>
      <input
        type="checkbox"
        class="idJudge"
        value="${renderArr[i].id}"
      />
</td>
<td>${renderArr[i].drugName}</td>
<td>
  <img
    src="${renderArr[i].src}"
    alt=""
  />
</td>
<td>${renderArr[i].price}</td>
<td>
    <input type="checkbox" 
    ${renderArr[i].sell}
    id="blankCheckbox" value=" "/>
</td>
<td><span class="statusJudge">${renderArr[i].status}</span></td>
<td>${renderArr[i].stock}</td>
<td>${renderArr[i].releaseTime}</td>
<td>
  <a class="drugDetailCheck">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
  <a class="drugDetailEdit">编辑</a>&nbsp;&nbsp;&nbsp;&nbsp;
  <a class="del">删除</a>&nbsp;&nbsp;&nbsp;&nbsp;
</td>`;
    //把tr插入tbody里面
    oTbody.appendChild(oTr);
  }

  //渲染页码
  //找到所有的1，2，3，4的页码
  var aPageBtn = document.querySelectorAll(".pageBtn");
  //删除所有的页码
  for (var i = 0; i < aPageBtn.length; i++) {
    oPagination.removeChild(aPageBtn[i].parentNode);
  }
  //根据数据的长度重新创建页码
  for (var i = 1; i <= Math.ceil(searchData.length / count); i++) {
    //创建li
    var oLi = document.createElement("li");
    //给li创建内容
    oLi.innerHTML = `<a class="pageBtn" href="#">${i}</a>`;
    //如果li和当前的页码一致，给他加一个选中的class
    if (i == page) {
      oLi.classList.add("active");
    }
    //在下一页的前面插入页码
    oPagination.insertBefore(oLi, oPagination.lastElementChild);
  }

  //渲染页脚
  oFooterBox.innerHTML = "";
  var oSpanFooter = document.createElement("span");
  oSpanFooter.innerHTML = `共${Math.ceil(searchData.length / count)}页/${
    searchData.length
  }条数据`;
  oFooterBox.appendChild(oSpanFooter);
}
render();

//给分页加事件
oPagination.addEventListener("click", changePage);
function changePage() {
  if (event.target.className == "pageBtn") {
    //修改page
    page = event.target.innerHTML;
    //渲染table，渲染分页
    render();
    oSelAll.checked = false;
    n = 0;
  }
}

//给上一页和下一页加事件
oPrevBtn.addEventListener("click", prev);
oNextBtn.addEventListener("click", next);
function prev() {
  if (page > 1) {
    page--;
    render();
    oSelAll.checked = false;
    n = 0;
  }
}
function next() {
  if (page < Math.ceil(data.length / count)) {
    page++;
    render();
    oSelAll.checked = false;
    n = 0;
  }
}

//删除
oTbody.addEventListener("click", delFn);
function delFn() {
  if (event.target.className.includes("del")) {
    //找到id
    var id = event.target.parentNode.parentNode.children[0].children[0].value;
    //循环数据对比
    for (var i = 0; i < data.length; i++) {
      if (data[i].id == id) {
        //删除id对应数据
        data.splice(i, 1);
      }
    }
    //重新渲染
    render();
    oSelAll.checked = false;
    n = 0;
    $("#delAllModal").modal("show");
  }
}

//批量删除
oDelAll.addEventListener("click", delAllFn);
function delAllFn() {
  if (event.target.className == "delAll") {
    var delArr = [];
    var aIdJudge = document.querySelectorAll(".idJudge");
    //判断所有选择项勾没勾选，把勾选的数据存进新数组delArr
    for (var i = 0; i < aIdJudge.length; i++) {
      if (aIdJudge[i].checked == true) {
        delArr.push(aIdJudge[i].value);
      }
    }
  }
  //双重for循环，删除对应id数据。
  if (delArr.length == 0) {
    $("#delAllFailModal").modal("show");
  } else {
    for (var i = 0; i < delArr.length; i++) {
      for (var j = 0; j < data.length; j++) {
        if (delArr[i] == data[j].id) {
          data.splice(j, 1);
        }
      }
    }
    render();
    oSelAll.checked = false;
    n = 0;
    $("#delAllModal").modal("show");
  }
}

//全选
oSelAll.onclick = function () {
  var aIdJudge = document.querySelectorAll(".idJudge");
  if (oSelAll.checked == true) {
    for (var i = 0; i < aIdJudge.length; i++) {
      aIdJudge[i].checked = true;
    }
    n = aIdJudge.length;
  } else {
    for (var i = 0; i < aIdJudge.length; i++) {
      aIdJudge[i].checked = false;
    }
    n = 0;
  }
};

//联动全选
oTbody.addEventListener("click", selectFn);
function selectFn() {
  var aIdJudge = document.querySelectorAll(".idJudge");
  if (event.target.className.includes("idJudge")) {
    if (event.target.checked == true) {
      n++;
    } else {
      n--;
    }
    if (n == aIdJudge.length) {
      oSelAll.checked = true;
    } else {
      oSelAll.checked = false;
    }
  }
}

//筛选框选项关联
oSelect1.addEventListener("click", select1Fn);
function select1Fn() {
  switch (event.target.value) {
    case "请选择分类":
      oSelect2.innerHTML = `
            <option selected="selected" value="请选择分类">请选择分类</option>
      <option class="part1" value="钙通道阻滞用药">钙通道阻滞用药</option>
      <option class="part1" value="慢性心功能不全">慢性心功能不全</option>
      <option class="part1" value="抗心律失常药">抗心律失常药</option>
      <option class="part2" value="镇咳药">镇咳药</option>
      <option class="part2" value="祛痰药">祛痰药</option>
      <option class="part2" value="平喘药">平喘药</option>
      <option class="part3" value="止痒药">止痒药</option>
      <option class="part3" value="消炎药">消炎药</option>
      <option class="part3" value="过敏药">过敏药</option>`;
      break;
    case "心血管系统用药":
      oSelect2.innerHTML = `<option selected="selected" value="请选择分类">请选择分类</option>
      <option class="part1" value="钙通道阻滞用药">钙通道阻滞用药</option>
      <option class="part1" value="慢性心功能不全">慢性心功能不全</option>
      <option class="part1" value="抗心律失常药">抗心律失常药</option>`;
      break;
    case "呼吸系统用药":
      oSelect2.innerHTML = `<option selected="selected" value="请选择分类">请选择分类</option>
            <option class="part2" value="镇咳药">镇咳药</option>
      <option class="part2" value="祛痰药">祛痰药</option>
      <option class="part2" value="平喘药">平喘药</option>`;
      break;
    case "皮肤科用药":
      oSelect2.innerHTML = `<option selected="selected" value="请选择分类">请选择分类</option>
            <option class="part3" value="止痒药">止痒药</option>
      <option class="part3" value="消炎药">消炎药</option>
      <option class="part3" value="过敏药">过敏药</option>`;
      break;
  }
}

// 筛选
oSearchBtn.addEventListener("click", searchFn);
function searchFn() {
  page = 1;
  render();
}

// 新增
//新增筛选关联
var oAddDrugClass1 = document.querySelector(".add-drug-class1");
var oAddDrugClass2 = document.querySelector(".add-drug-class2");
oAddDrugClass1.addEventListener("click", AddDrugClass1Fn);
function AddDrugClass1Fn() {
  switch (event.target.value) {
    case "请选择分类":
      oAddDrugClass2.innerHTML = `
            <option selected="selected" value="请选择分类">请选择分类</option>
      <option class="part1" value="钙通道阻滞用药">钙通道阻滞用药</option>
      <option class="part1" value="慢性心功能不全">慢性心功能不全</option>
      <option class="part1" value="抗心律失常药">抗心律失常药</option>
      <option class="part2" value="镇咳药">镇咳药</option>
      <option class="part2" value="祛痰药">祛痰药</option>
      <option class="part2" value="平喘药">平喘药</option>
      <option class="part3" value="止痒药">止痒药</option>
      <option class="part3" value="消炎药">消炎药</option>
      <option class="part3" value="过敏药">过敏药</option>`;
      break;
    case "心血管系统用药":
      oAddDrugClass2.innerHTML = `<option selected="selected" value="请选择分类">请选择分类</option>
      <option class="part1" value="钙通道阻滞用药">钙通道阻滞用药</option>
      <option class="part1" value="慢性心功能不全">慢性心功能不全</option>
      <option class="part1" value="抗心律失常药">抗心律失常药</option>`;
      break;
    case "呼吸系统用药":
      oAddDrugClass2.innerHTML = `<option selected="selected" value="请选择分类">请选择分类</option>
            <option class="part2" value="镇咳药">镇咳药</option>
      <option class="part2" value="祛痰药">祛痰药</option>
      <option class="part2" value="平喘药">平喘药</option>`;
      break;
    case "皮肤科用药":
      oAddDrugClass2.innerHTML = `<option selected="selected" value="请选择分类">请选择分类</option>
            <option class="part3" value="止痒药">止痒药</option>
      <option class="part3" value="消炎药">消炎药</option>
      <option class="part3" value="过敏药">过敏药</option>`;
      break;
  }
}
//新增页面显示
oAddBtn.addEventListener("click", addShowFn);
function addShowFn() {
  oDrugManagement.classList.remove("active2");
  oNewDrugs.style.display = "block";
}
//新增页面保存、返回和取消
oNewDrugs.addEventListener("click", newDrugsFunctionFn);
function newDrugsFunctionFn() {
  var oAddDrugsName = document.querySelector(".add-drug-name");
  var oAddDrugImg = document.querySelector(".add-drug-img");
  var oAddRecommend = document.querySelector(".add-recommend");
  var oAddDrugsSpecifications = document.querySelector(
    ".add-drugs-specifications"
  );
  var oAddDrugsPrice = document.querySelector(".add-drugs-price");
  var oAddDrugsStock = document.querySelector(".add-drugs-stock");
  var oAddPrescription = document.querySelector(".add-prescription");
  var oAddDrugCompanies = document.querySelector(".add-drug-companies");
  var oAddDrugSell = document.querySelector(".add-drug-sell");
  var oAddReleaseTime = new Date().toLocaleString();
  var idNumber = data.length;
  //返回，取消)
  if (
    event.target.className.includes("add-goBack") ||
    event.target.className.includes("add-cancel")
  ) {
    oDrugManagement.classList.add("active2");
    oNewDrugs.style.display = "none";
    oAddDrugsName.value = "";
    oAddDrugImg.src = "../images/list-img.png";
    oAddDrugClass1.value = "";
    oAddDrugClass2.value = "";
    oAddDrugsSpecifications.value = "";
    oAddDrugsPrice.value = "";
    oAddDrugsStock.value = "";
    oAddPrescription.value = "";
    oAddDrugCompanies.value = "";
  }
  //保存
  if (event.target.className.includes("add-drug-img")) {
    event.target.src = "../images/add-drug-img.png";
  }
  if (event.target.className.includes("add-submit")) {
    if (oAddDrugSell.checked == true) {
      data.push({
        id: idNumber++,
        drugName: oAddDrugsName.value,
        src: oAddDrugImg.src,
        Specification: oAddDrugsSpecifications.value, //规格
        price: oAddDrugsPrice.value,
        drugCompanies: oAddDrugCompanies.value, //药企
        sell: "checked",
        stock: oAddDrugsStock.value, //库存
        prescription: oAddPrescription.value, //处方药
        drugClassification1: oAddDrugClass1.value, //一级分类
        drugClassification2: oAddDrugClass2.value, //二级分类
        status: "审核通过", //审核状态
        releaseTime: oAddReleaseTime, //发布时间})
      });
    } else {
      data.push({
        id: idNumber++,
        drugName: oAddDrugsName.value,
        src: oAddDrugImg.src,
        Specification: oAddDrugsSpecifications.value, //规格
        price: oAddDrugsPrice.value,
        drugCompanies: oAddDrugCompanies.value, //药企
        sell: "",
        stock: oAddDrugsStock.value, //库存
        prescription: oAddPrescription.value, //处方药
        drugClassification1: oAddDrugClass1.value, //一级分类
        drugClassification2: oAddDrugClass2.value, //二级分类
        status: "审核通过", //审核状态
        releaseTime: oAddReleaseTime, //发布时间})
      });
    }
    oDrugManagement.classList.add("active2");
    oNewDrugs.style.display = "none";
    page = Math.ceil(idNumber / 10);
    render();
    $("#addModal").modal("show");
    oAddDrugsName.value = "";
    oAddDrugImg.src = "../images/list-img.png";
    oAddDrugClass1.value = "";
    oAddDrugClass2.value = "";
    oAddDrugsSpecifications.value = "";
    oAddDrugsPrice.value = "";
    oAddDrugsStock.value = "";
    oAddPrescription.value = "";
    oAddDrugCompanies.value = "";
  }
}

//审核通过、未通过 、编辑页面显示
oTbody.addEventListener("click", drugDetailCheckFn);
function drugDetailCheckFn() {
  // 查看页面显示
  if (event.target.className.includes("drugDetailCheck")) {
    oDrugManagement.classList.remove("active2");
    var statusArr = [];
    var statusId =
      event.target.parentNode.parentNode.children[0].children[0].value;
    for (var i = 0; i < data.length; i++) {
      if (data[i].id == statusId) {
        statusArr.push(data[i]);
      }
    }
    //审核通过
    if (
      event.target.parentNode.parentNode.children[5].children[0].innerHTML ==
      "审核通过"
    ) {
      oDrugsStatusSuccess.style.display = "block";
      oStatusSuccessTbody.innerHTML = ` <tr class="tr1">
      <td rowspan="5" class="drugs-img">
        <img
          src="${statusArr[0].src}"
          alt=""
        />
      </td>
      <td class="active td1">ID</td>
      <td class="td2">${statusArr[0].id}</td>
      <td class="active td3">药品名称</td>
      <td class="td4">${statusArr[0].drugName}</td>
      </tr>
      <tr class="tr2">
      <td class="active">规格</td>
      <td>${statusArr[0].Specification}</td>
      <td class="active">价格</td>
      <td>￥${statusArr[0].price}</td>
      </tr>
      <tr class="tr3">
      <td class="active">药企</td>
      <td>${statusArr[0].drugCompanies}</td>
      <td class="active">库存</td>
      <td>${statusArr[0].stock}</td>
      </tr>
      <tr class="tr4">
      <td class="active">是否为处方药</td>
      <td>${statusArr[0].prescription}</td>
      <td class="active">药品分类</td>
      <td>${statusArr[0].drugClassification1}>${statusArr[0].drugClassification2}</td>
      </tr>
      <tr tr class="tr5">
      <td class="active">发布时间</td>
      <td>${statusArr[0].releaseTime}</td>
      <td class="active">状态</td>
      <td>${statusArr[0].status}</td>
      </tr>
      `;
    } else {
      oDrugsStatusFailed.style.display = "block";
      oStatusFailedTbody.innerHTML = `<tr class="tr1">
      <td rowspan="5" class="drugs-img">
        <img
          src="${statusArr[0].src}"
        />
      </td>
      <td class="active td1">ID</td>
      <td class="td2">${statusArr[0].id}</td>
      <td class="active td3">药品名称</td>
      <td class="td4">${statusArr[0].drugName}</td>
    </tr>
    <tr class="tr2">
      <td class="active">规格</td>
      <td>${statusArr[0].Specification}</td>
      <td class="active">价格</td>
      <td>￥${statusArr[0].price}</td>
    </tr>
    <tr class="tr3">
      <td class="active">药企</td>
      <td>${statusArr[0].drugCompanies}</td>
      <td class="active">库存</td>
      <td>${statusArr[0].stock}</td>
    </tr>
    <tr class="tr4">
      <td class="active">是否为处方药</td>
      <td>${statusArr[0].prescription}</td>
      <td class="active">药品分类</td>
      <td>${statusArr[0].drugClassification1}>${statusArr[0].drugClassification2}</td>
    </tr>
    <tr class="tr5">
      <td class="active">发布时间</td>
      <td>${statusArr[0].releaseTime}</td>
      <td class="active">状态</td>
      <td>
        <span>${statusArr[0].status}</span>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <a class="check-detail">审核详情</a>
      </td>
    </tr>`;
    }
  }
  // 编辑页面显示
  if (event.target.className.includes("drugDetailEdit")) {
    oDrugManagement.classList.remove("active2");
    oEditDrugs.style.display = "block";
    var editArr = [];
    var editId =
      event.target.parentNode.parentNode.children[0].children[0].value;
    for (var i = 0; i < data.length; i++) {
      if (data[i].id == editId) {
        editArr.push(data[i]);
      }
    }
    oEditContext.innerHTML = `
    <div><span>ID:</span><span class="drug-id">${editArr[0].id}</span></div>
    <div class="drug-name">
    <span>药品名称</span><span class="star">*</span
    ><input class="edit-drug-name" type="text" placeholder="请输入..." value="${editArr[0].drugName}"/>
  </div>
  <div class="drug-img">
    <span>列表图</span><span class="star">*</span>
    <img class="edit-drug-img" src="${editArr[0].src}" alt="" />
    <div class="notice">
      <span>建议尺寸120*90像素 ,大小不要超过1M</span>
    </div>
  </div>
  <div class="recommend">
    <span>是否推荐</span><span class="star">*</span>
    <input class="edit-recommend" type="checkbox" ${editArr[0].recommend}/>
  </div>
  <div class="drug-class">
    <span>药品分类</span><span class="star">*</span>
    <select class="edit-drug-class1" name="" id="" class="edit-drug-class1" value="${editArr[0].drugClassification1}">
      <option value="请选择分类">请选择分类</option>
      <option value="心血管系统用药">心血管系统用药</option>
      <option value="呼吸系统用药">呼吸系统用药</option>
      <option value="皮肤科用药">皮肤科用药</option>
    </select>
    <select class="edit-drug-class2" name="" id="" class="edit-drug-class2" value="${editArr[0].drugClassification2}">
      <option selected="selected" value="请选择分类">请选择分类</option>
      <option class="part1" value="钙通道阻滞用药">钙通道阻滞用药</option>
      <option class="part1" value="慢性心功能不全">慢性心功能不全</option>
      <option class="part1" value="抗心律失常药">抗心律失常药</option>
      <option class="part2" value="镇咳药">镇咳药</option>
      <option class="part2" value="祛痰药">祛痰药</option>
      <option class="part2" value="平喘药">平喘药</option>
      <option class="part3" value="止痒药">止痒药</option>
      <option class="part3" value="消炎药">消炎药</option>
      <option class="part3" value="过敏药">过敏药</option>
    </select>
  </div>
  <div class="drugs-specifications">
    <span>规格</span>
    <span class="star">*</span>
    <input class="edit-drugs-specifications" type="text" placeholder="请输入..." value="${editArr[0].Specification}"/>
  </div>
  <div class="drugs-price">
    <span>价格</span><span class="star">*</span>
    <div class="price-box">
      <span>￥</span>
      <input class="edit-drugs-price" type="text" placeholder="请输入..." value="${editArr[0].price}"/>
    </div>
  </div>
  <div class="drugs-stock">
    <span>库存</span><span class="star">*</span>
    <input class="edit-drugs-stock" type="text" placeholder="请输入..." value="${editArr[0].stock}"/>
  </div>
  <div class="prescription">
    <span>是否处方药</span><span class="star">*</span>
    <input class="edit-prescription" type="text" value="${editArr[0].prescription}"/>
  </div>
  <div class="drug-companies">
    <span>药企</span><span class="star">*</span>
    <input class="edit-drug-companies" type="text" placeholder="请输入..." value="${editArr[0].drugCompanies}"/>
  </div>
  <div class="drug-sell">
    <span>上架</span><span class="star">*</span>
    <input class="edit-drug-sell" type="checkbox" ${editArr[0].sell}/>
  </div>
  <div class="drug-describe">
    <p><span>详细介绍</span><span class="star">*</span></p>
  </div>
  <!-- 富文本编辑器 -->
  <div id="editor—wrapper">
    <div id="toolbar-container"><!-- 工具栏 --></div>
    <div id="editor-container"><!-- 编辑器 --></div>
  </div>
  <div class="btn-box">
    <button class="edit-submit">提交</button>
    <button class="edit-cancel">取消</button>
  </div>`;
  }
}

//审核通过、审核未通过返回
document.body.addEventListener("click", drugDetailCheckBackFn);
function drugDetailCheckBackFn() {
  if (event.target.className.includes("nav")) {
    oNewDrugs.style.display = "none";
    oEditDrugs.style.display = "none";
    oDrugsStatusSuccess.style.display = "none";
    oDrugsStatusFailed.style.display = "none";
    oUnaudited.style.display = "none";
  }
  if (
    event.target.className.includes("success-goBack") ||
    event.target.className.includes("failed-goBack")
  ) {
    oDrugsStatusSuccess.style.display = "none";
    oDrugsStatusFailed.style.display = "none";
    oDrugManagement.classList.add("active2");
  }
}

//审核未通过审核详情
oDrugsStatusFailed.addEventListener("click", checkDetailFn);
function checkDetailFn() {
  if (event.target.className.includes("check-detail")) {
    $("#auditFailedModal").modal("show");
  }
}

// 编辑筛选关联
oEditContext.addEventListener("click", editDrugClass1Fn);
function editDrugClass1Fn() {
  //获取编辑筛选关联
  var oEditDrugClass1 = document.querySelector(".edit-drug-class1");
  var oEditDrugClass2 = document.querySelector(".edit-drug-class2");
  if (event.target.className.includes("edit-drug-class1")) {
    switch (event.target.value) {
      case "请选择分类":
        oEditDrugClass2.innerHTML = `
            <option selected="selected" value="请选择分类">请选择分类</option>
      <option class="part1" value="钙通道阻滞用药">钙通道阻滞用药</option>
      <option class="part1" value="慢性心功能不全">慢性心功能不全</option>
      <option class="part1" value="抗心律失常药">抗心律失常药</option>
      <option class="part2" value="镇咳药">镇咳药</option>
      <option class="part2" value="祛痰药">祛痰药</option>
      <option class="part2" value="平喘药">平喘药</option>
      <option class="part3" value="止痒药">止痒药</option>
      <option class="part3" value="消炎药">消炎药</option>
      <option class="part3" value="过敏药">过敏药</option>`;
        break;
      case "心血管系统用药":
        oEditDrugClass2.innerHTML = `<option selected="selected" value="请选择分类">请选择分类</option>
      <option class="part1" value="钙通道阻滞用药">钙通道阻滞用药</option>
      <option class="part1" value="慢性心功能不全">慢性心功能不全</option>
      <option class="part1" value="抗心律失常药">抗心律失常药</option>`;
        break;
      case "呼吸系统用药":
        oEditDrugClass2.innerHTML = `<option selected="selected" value="请选择分类">请选择分类</option>
            <option class="part2" value="镇咳药">镇咳药</option>
      <option class="part2" value="祛痰药">祛痰药</option>
      <option class="part2" value="平喘药">平喘药</option>`;
        break;
      case "皮肤科用药":
        oEditDrugClass2.innerHTML = `<option selected="selected" value="请选择分类">请选择分类</option>
            <option class="part3" value="止痒药">止痒药</option>
      <option class="part3" value="消炎药">消炎药</option>
      <option class="part3" value="过敏药">过敏药</option>`;
        break;
    }
  }
}

//编辑页面保存、返回和取消
oEditDrugs.addEventListener("click", editDrugsHideFn);
function editDrugsHideFn() {
  //返回和取消
  if (
    event.target.className.includes("edit-goBack") ||
    event.target.className.includes("edit-cancel")
  ) {
    oDrugManagement.classList.add("active2");
    oEditDrugs.style.display = "none";
  }
  //编辑页面保存
  if (event.target.className.includes("edit-submit")) {
    var sDrugId = document.querySelector(".drug-id").innerHTML;
    var sEditDrugName = document.querySelector(".edit-drug-name").value;
    var sEditDrugImg = document.querySelector(".edit-drug-img").src;
    var sEditRecommend = document.querySelector(".edit-recommend").checked;
    var sEditDrugClass1 = document.querySelector(".edit-drug-class1").value;
    var sEditDrugClass2 = document.querySelector(".edit-drug-class2").value;
    var sEditDrugsSpecifications = document.querySelector(
      ".edit-drugs-specifications"
    ).value;
    var sEditDrugsPrice = document.querySelector(".edit-drugs-price").value;
    var sEditDrugsStock = document.querySelector(".edit-drugs-stock").value;
    var sEditPrescription = document.querySelector(".edit-prescription").value;
    var sEditDrugCompanies = document.querySelector(
      ".edit-drug-companies"
    ).value;
    var sEditDrugSell = document.querySelector(".edit-drug-sell").checked;
    for (var i = 0; i < data.length; i++) {
      if (data[i].id == sDrugId) {
        data[i].drugName = sEditDrugName;
        data[i].src = sEditDrugImg;
        data[i].Specification = sEditDrugsSpecifications;
        data[i].price = sEditDrugsPrice;
        data[i].drugCompanies = sEditDrugCompanies;
        data[i].stock = sEditDrugsStock;
        data[i].prescription = sEditPrescription;
        data[i].drugClassification1 = sEditDrugClass1;
        data[i].drugClassification2 = sEditDrugClass2;
        data[i].releaseTime = new Date().toLocaleString();
        switch (sEditDrugSell) {
          case true:
            data[i].sell = "checked";
            break;
          case false:
            data[i].sell = "";
            break;
        }
        switch (sEditRecommend) {
          case true:
            data[i].recommend = "checked";
            break;
          case false:
            data[i].recommend = "";
            break;
        }
      }
    }
    render();
    oDrugManagement.classList.add("active2");
    oEditDrugs.style.display = "none";
  }
}
/*      每页是10条  count
        data
     1   0-10
     2   10-20
     3   20-30
     n   (n-1)*count   n*count
 -----------------------------
         data  每页是10条  count

     1    1
     10   1
     11   2
     20   2
     21   3
     n    Math.ceil(n/count)
*/
var oDrugClassTbody = document.querySelector(".drugClassTbody");
var oPaging = document.querySelector("#paging");
var oFooterBox2 = document.querySelector(".footerBox2");
var page2 = 1;
var count2 = 10;
var oPageBox = document.querySelector(".pageBox");
var oSelAll2 = document.querySelector(".selectAll2");
var m = 0;
var level = 1; //级别
var oDrugClassification = document.querySelector(".drugClassification");
var oNewDrugClassification = document.querySelector("#newDrugClassification");

//药品分类
function render2() {
  //让tbody为空
  oDrugClassTbody.innerHTML = "";
  //根据count和page渲染数据
  var renderArr = data.slice((page2 - 1) * count2, page2 * count2);
  //循环要渲染的数据
  for (var i = 0; i < renderArr.length; i++) {
    //创建tr
    var oTr = document.createElement("tr");
    //给创建内容
    oTr.innerHTML = `<td>
        <input class="idJudge2" type="checkbox" id="blankCheckbox" value="${renderArr[i].id}" />
  </td>
  <td>${renderArr[i].drugClassification1}</td>
  <td>${level}级</td>
  <td>${renderArr[i].displayStatus}</td>
  <td>${renderArr[i].remarks}</td>
  <td>${renderArr[i].uploadedBy}</td>
  <td>${renderArr[i].addTime}</td>
  <td>
    <a class="window2Add">新增下级</a>&nbsp;&nbsp;&nbsp;&nbsp;
    <a class="window2Check">查看下级</a
    >&nbsp;&nbsp;&nbsp;&nbsp;
    <a class="window2Edit">编辑</a>&nbsp;&nbsp;&nbsp;&nbsp;
    <a class="window2Del">删除</a>&nbsp;&nbsp;&nbsp;&nbsp;
  </td>`;
    //把tr插入tbody里面
    oDrugClassTbody.appendChild(oTr);
  }

  //渲染页码
  //找到所有的1，2，3，4的页码
  var aDrugClassPageBtn = document.querySelectorAll(".drugClass-pageBtn");
  //删除所有的页码
  for (var i = 0; i < aDrugClassPageBtn.length; i++) {
    oPaging.removeChild(aDrugClassPageBtn[i].parentNode);
  }
  //根据数据的长度重新创建页码
  for (var i = 1; i <= Math.ceil(data.length / count2); i++) {
    //创建li
    var oLi = document.createElement("li");
    //给li创建内容
    oLi.innerHTML = `<a class="drugClass-pageBtn" href="#">${i}</a>`;
    //如果li和当前的页码一致，给他加一个选中的class
    if (i == page2) {
      oLi.classList.add("active");
    }
    //在下一页的前面插入页码
    oPaging.insertBefore(oLi, oPaging.lastElementChild);
  }

  //渲染页脚
  oFooterBox2.innerHTML = "";
  var oSpanFooter1 = document.createElement("span");
  oSpanFooter1.innerHTML = `共${Math.ceil(data.length / count2)}页/${
    data.length
  }条数据`;
  oFooterBox2.appendChild(oSpanFooter1);
}
render2();

//给分页加事件
oPaging.addEventListener("click", changePageFn);
function changePageFn() {
  if (event.target.className == "drugClass-pageBtn") {
    //修改page
    page2 = event.target.innerHTML;
    //渲染table，渲染分页
    render2();
    oSelAll2.checked = false;
    m = 0;
  }
}

//给上一页和下一页加事件
oPageBox.addEventListener("click", prevNext);
function prevNext() {
  if (event.target.className.includes("prev2")) {
    if (page2 > 1) {
      page2--;
      render2();
      oSelAll2.checked = false;
      m = 0;
    }
  }
  if (event.target.className.includes("next2")) {
    if (page2 < Math.ceil(data.length / count2)) {
      page2++;
      render2();
      oSelAll2.checked = false;
      m = 0;
    }
  }
}

//删除
oDrugClassTbody.addEventListener("click", delFn2);
function delFn2() {
  if (event.target.className.includes("window2Del")) {
    //找到id
    var id = event.target.parentNode.parentNode.children[0].children[0].value;
    //循环数据对比
    for (var i = 0; i < data.length; i++) {
      if (data[i].id == id) {
        //删除id对应数据
        data.splice(i, 1);
      }
    }
    //重新渲染
    render2();
    oSelAll2.checked = false;
    m = 0;
    $("#delAllModal").modal("show");
  }
}

var oDelAll2 = document.querySelector(".delAll2");

//批量删除
oDelAll2.addEventListener("click", delAllFn2);
function delAllFn2() {
  if (event.target.className == "delAll2") {
    var delArr = [];
    var aIdJudge2 = document.querySelectorAll(".idJudge2");
    //判断所有选择项勾没勾选，把勾选的数据存进新数组delArr
    for (var i = 0; i < aIdJudge2.length; i++) {
      if (aIdJudge2[i].checked == true) {
        delArr.push(aIdJudge2[i].value);
      }
    }
  }
  //双重for循环，删除对应id数据。
  if (delArr.length == 0) {
    $("#delAllFailModal").modal("show");
  } else {
    for (var i = 0; i < delArr.length; i++) {
      for (var j = 0; j < data.length; j++) {
        if (delArr[i] == data[j].id) {
          data.splice(j, 1);
        }
      }
    }
    render2();
    oSelAll2.checked = false;
    m = 0;
    $("#delAllModal").modal("show");
  }
}

//全选
oSelAll2.onclick = function () {
  var aIdJudge2 = document.querySelectorAll(".idJudge2");
  if (oSelAll2.checked == true) {
    for (var i = 0; i < aIdJudge2.length; i++) {
      aIdJudge2[i].checked = true;
    }
    m = aIdJudge2.length;
  } else {
    for (var i = 0; i < aIdJudge2.length; i++) {
      aIdJudge2[i].checked = false;
    }
  }
  m = 0;
};

//联动全选
oDrugClassTbody.addEventListener("click", selectFn2);
function selectFn2() {
  var aIdJudge2 = document.querySelectorAll(".idJudge2");
  if (event.target.className.includes("idJudge2")) {
    if (event.target.checked == true) {
      m++;
    } else {
      m--;
    }
    if (m == aIdJudge2.length) {
      oSelAll2.checked = true;
    } else {
      oSelAll2.checked = false;
    }
  }
}

//新增下级页面显示   查看下级  编辑
oDrugClassification.addEventListener("click", newDrugClassShow);
function newDrugClassShow() {
  if (
    event.target.className.includes("newClassification") ||
    event.target.className.includes("window2Add")
  ) {
    $("#newDrugClassification").modal("show");
  }
  if (event.target.className.includes("window2Check")) {
    level++;
    //让tbody为空
    oDrugClassTbody.innerHTML = "";
    //根据count和page渲染数据
    var renderArr = data.slice((page2 - 1) * count2, page2 * count2);
    //循环要渲染的数据
    for (var i = 0; i < renderArr.length; i++) {
      //创建tr
      var oTr = document.createElement("tr");
      //给创建内容
      oTr.innerHTML = `<td>
        <input class="idJudge2" type="checkbox" id="blankCheckbox" value="${renderArr[i].id}" />
  </td>
  <td>${renderArr[i].drugClassification2}</td>
  <td>${level}级</td>
  <td>${renderArr[i].displayStatus}</td>
  <td>${renderArr[i].remarks}</td>
  <td>${renderArr[i].uploadedBy}</td>
  <td>${renderArr[i].addTime}</td>
  <td>
    <a class="window2Add">新增下级</a>&nbsp;&nbsp;&nbsp;&nbsp;
    <a class="window2Check">查看下级</a
    >&nbsp;&nbsp;&nbsp;&nbsp;
    <a class="window2Edit">编辑</a>&nbsp;&nbsp;&nbsp;&nbsp;
    <a class="window2Del">删除</a>&nbsp;&nbsp;&nbsp;&nbsp;
  </td>`;
      //把tr插入tbody里面
      oDrugClassTbody.appendChild(oTr);
    }

    //渲染页码
    //找到所有的1，2，3，4的页码
    var aDrugClassPageBtn = document.querySelectorAll(".drugClass-pageBtn");
    //删除所有的页码
    for (var i = 0; i < aDrugClassPageBtn.length; i++) {
      oPaging.removeChild(aDrugClassPageBtn[i].parentNode);
    }
    //根据数据的长度重新创建页码
    for (var i = 1; i <= Math.ceil(data.length / count2); i++) {
      //创建li
      var oLi = document.createElement("li");
      //给li创建内容
      oLi.innerHTML = `<a class="drugClass-pageBtn" href="#">${i}</a>`;
      //如果li和当前的页码一致，给他加一个选中的class
      if (i == page2) {
        oLi.classList.add("active");
      }
      //在下一页的前面插入页码
      oPaging.insertBefore(oLi, oPaging.lastElementChild);
    }

    //渲染页脚
    oFooterBox2.innerHTML = "";
    var oSpanFooter1 = document.createElement("span");
    oSpanFooter1.innerHTML = `共${Math.ceil(data.length / count2)}页/${
      data.length
    }条数据`;
    oFooterBox2.appendChild(oSpanFooter1);
  }
  if (event.target.className.includes("window2Edit")) {
    var oEditClassBody = document.querySelector(".editClassBody");
    var editClassArr = [];
    var editClassId =
      event.target.parentNode.parentNode.children[0].children[0].value;
    $("#editDrugClassification").modal("show");
    for (var i = 0; i < data.length; i++) {
      if (data[i].id == editClassId) {
        editClassArr.push(data[i]);
        if (editClassArr[0].displayStatus == "显示") {
          oEditClassBody.innerHTML = `<div><span>ID:</span><span  class="editPageId">${editClassArr[0].id}</span></div><div class="classificationName">
        <span>分类名称:</span>
        <input
          class="edit-classificationName"
          type="text"
          placeholder="请输入..."
          value="${editClassArr[0].drugClassification2}"
        />
      </div>
      <div class="categoryParent">
        <span>上级分类:</span>
        <select class="edit-categoryParent" name="" id="" value='${editClassArr[0].drugClassification1}'>
          <option value="内科" selected>内科</option>
          <option value="外科">外科</option>
          <option value="儿科">儿科</option>
        </select>
        <span>不选择分类默认未顶级分类</span>
      </div>
      <div class="addRemarks">
        <span>备注:</span
        >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input
          class="editRemarks"
          type="text"
          value="${editClassArr[0].remarks}"
        />
      </div>
      <div class="addDisplay">
        <span>是否显示:</span>&nbsp;<input
          class="editDisplay"
          type="checkbox" checked
        />
      </div>`;
        } else {
          oEditClassBody.innerHTML = `<div><span>ID:</span><span  class="editPageId">${editClassArr[0].id}</span></div><div class="classificationName">
        <span>分类名称:</span>
        <input
          class="edit-classificationName"
          type="text"
          placeholder="请输入..."
          value="${editClassArr[0].drugClassification2}"
        />
      </div>
      <div class="categoryParent">
        <span>上级分类:</span>
        <select class="edit-categoryParent" name="" id="" value='${editClassArr[0].drugClassification1}'>
          <option value="内科" selected>内科</option>
          <option value="外科">外科</option>
          <option value="儿科">儿科</option>
        </select>
        <span>不选择分类默认未顶级分类</span>
      </div>
      <div class="addRemarks">
        <span>备注:</span
        >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input
          class="editRemarks"
          type="text"
          value="${editClassArr[0].remarks}"
        />
      </div>
      <div class="addDisplay">
        <span>是否显示:</span>&nbsp;<input
          class="editDisplay"
          type="checkbox" 
        />
      </div>`;
        }
      }
    }
  }
}
//新增下级保存，隐藏
oNewDrugClassification.addEventListener("click", newDrugClassHide);
function newDrugClassHide() {
  if (event.target.className.includes("addConfirm")) {
    var addClassId = data.length;
    var sAddClassId = addClassId++;
    var sAddClassificationName = document.querySelector(
      ".add-classificationName"
    ).value;
    var sAddCategoryParent = document.querySelector(
      ".add-categoryParent"
    ).value;
    var sAddRemarks = document.querySelector(".add-addRemarks").value;
    var sAddDisplay = document.querySelector(".add-addDisplay").checked;
    var sAddTime = new Date().toLocaleString();
    if (sAddDisplay) {
      data.push({
        id: sAddClassId,
        drugClassification1: sAddCategoryParent,
        drugClassification2: sAddClassificationName,
        remarks: sAddRemarks,
        displayStatus: "显示",
        addTime: sAddTime,
        uploadedBy: "喻志超",
      });
    } else {
      data.push({
        id: sAddClassId,
        drugClassification1: sAddCategoryParent,
        drugClassification2: sAddClassificationName,
        remarks: sAddRemarks,
        displayStatus: "不显示",
        addTime: sAddTime,
        uploadedBy: "喻志超",
      });
    }
    render2();
    $("#newDrugClassification").modal("hide");
  }
}

//编辑保存
var oEditDrugClass = document.querySelector("#editDrugClassification");
oEditDrugClass.addEventListener("click", editSaveFn);
function editSaveFn() {
  if (event.target.className.includes("editConfirm")) {
    var sEditId = document.querySelector(".editPageId").innerHTML;
    var sEditClassName = document.querySelector(
      ".edit-classificationName"
    ).value;
    var sEditCategoryParent = document.querySelector(
      ".edit-categoryParent"
    ).value;
    var sEitRemarks = document.querySelector(".editRemarks").value;
    var sEditDisplay = document.querySelector(".editDisplay").checked;
    for (var i = 0; i < data.length; i++) {
      if (data[i].id == sEditId) {
        data[i].drugClassification2 = sEditClassName;
        data[i].drugClassification1 = sEditCategoryParent;
        data[i].remarks = sEitRemarks;
        if (sEditDisplay) {
          data[i].displayStatus = "显示";
        } else {
          data[i].displayStatus = "不显示";
        }
      }
    }
    render2();
    $("#editDrugClassification").modal("hide");
  }
}

//药品审核
var auditData = [
  {
    id: 1,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "未上架",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "钙通道阻滞用药", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "不显示",
    remarks: "备注内容1",
  },
  {
    id: 2,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*10片/盒", //规格
    price: 35,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "未上架",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "慢性心功能不全", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容2",
  },
  {
    id: 3,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*20片/盒", //规格
    price: 45,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "未上架",
    stock: 90, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "抗心律失常药", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容3",
  },
  {
    id: 4,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "6mg*7片/盒", //规格
    price: 21,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "未上架",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "呼吸系统用药", //一级分类
    drugClassification2: "镇咳药", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容4",
  },
  {
    id: 5,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "未上架",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "呼吸系统用药", //一级分类
    drugClassification2: "祛痰药", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容5",
  },
  {
    id: 6,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "未上架",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "呼吸系统用药", //一级分类
    drugClassification2: "平喘药", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容6",
  },
  {
    id: 7,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "未上架",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "皮肤科用药", //一级分类
    drugClassification2: "止痒药", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容7",
  },
  {
    id: 8,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "10mg*20片/盒", //规格
    price: 55,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "未上架",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "皮肤科用药", //一级分类
    drugClassification2: "过敏药 ", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容8",
  },
  {
    id: 9,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*5片/盒", //规格
    price: 15,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "未上架",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "钙通道阻滞用药", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容9",
  },
  {
    id: 10,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "未上架",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "钙通道阻滞用药", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容10",
  },
  {
    id: 11,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "未上架",
    stock: 22, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "抗心律失常药",
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容11",
  },
  {
    id: 12,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "未上架",
    stock: 32, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "钙通道阻滞用药", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容12",
  },
  {
    id: 13,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "未上架",
    stock: 55, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "抗心律失常药", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容13",
  },
  {
    id: 14,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 20,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "未上架",
    stock: 77, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "慢性心功能不全", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容14",
  },
  {
    id: 15,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "未上架",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "钙通道阻滞用药", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容15",
  },
  {
    id: 16,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "未上架",
    stock: 120, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "慢性心功能不全", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容16",
  },
  {
    id: 17,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "未上架",
    stock: 110, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "抗心律失常药", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容17",
  },
  {
    id: 18,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "未上架",
    stock: 34, //库存
    prescription: "是", //处方药
    drugClassification1: "呼吸系统用药", //一级分类
    drugClassification2: "祛痰药", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容18",
  },
  {
    id: 19,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "未上架",
    stock: 66, //库存
    prescription: "是", //处方药
    drugClassification1: "皮肤科用药", //一级分类
    drugClassification2: "消炎药", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容19",
  },
  {
    id: 20,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "未上架",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "抗心律失常药", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容20",
  },
  {
    id: 21,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "未上架",
    stock: 12, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "慢性心功能不全", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容21",
  },
  {
    id: 22,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "未上架",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "钙通道阻滞用药", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容22",
  },
  {
    id: 23,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "未上架",
    stock: 90, //库存
    prescription: "是", //处方药
    drugClassification1: "呼吸系统用药", //一级分类
    drugClassification2: "镇咳药", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容23",
  },
  {
    id: 24,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "未上架",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "呼吸系统用药", //一级分类
    drugClassification2: "祛痰药", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容24",
  },
  {
    id: 25,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "未上架",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "呼吸系统用药", //一级分类
    drugClassification2: "平喘药", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容25",
  },
  {
    id: 26,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "未上架",
    stock: 65, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "抗心律失常药", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容26",
  },
  {
    id: 27,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "未上架",
    stock: 80, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "钙通道阻滞用药", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容27",
  },
  {
    id: 28,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 35,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "未上架",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "慢性心功能不全", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容28",
  },
  {
    id: 29,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "未上架",
    stock: 112, //库存
    prescription: "是", //处方药
    drugClassification1: "皮肤科用药", //一级分类
    drugClassification2: "过敏药 ", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容29",
  },
  {
    id: 30,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "哈药集团", //药企
    sell: "未上架",
    stock: 45, //库存
    prescription: "是", //处方药
    drugClassification1: "皮肤科用药", //一级分类
    drugClassification2: "消炎药", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容30",
  },
  {
    id: 31,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "未上架",
    stock: 65, //库存
    prescription: "是", //处方药
    drugClassification1: "皮肤科用药", //一级分类
    drugClassification2: "止痒药", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容31",
  },
  {
    id: 32,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "哈药集团", //药企
    sell: "未上架",
    stock: 87, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "钙通道阻滞用药", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容32",
  },
  {
    id: 33,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "哈药集团", //药企
    sell: "未上架",
    stock: 124, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "慢性心功能不全", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容33",
  },
  {
    id: 34,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "辉瑞制药有限公司", //药企
    sell: "未上架",
    stock: 100, //库存
    prescription: "是", //处方药
    drugClassification1: "心血管系统用药", //一级分类
    drugClassification2: "抗心律失常药", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容34",
  },
  {
    id: 35,
    drugName: "络活喜苯磺酸氨氯地平片 ",
    src: "https://cimg.axureshop.com/90/7b/9a/907b9a01ce1f49f0a29a8c9909478853/images/处方详情-审核中/u2849.png",
    Specification: "5mg*7片/盒", //规格
    price: 25,
    drugCompanies: "哈药集团", //药企
    sell: "未上架",
    stock: 64, //库存
    prescription: "是", //处方药
    drugClassification1: "呼吸系统用药", //一级分类
    drugClassification2: "平喘药", //二级分类
    status: "待审核",
    releaseTime: "2020/02/07 21:00:00", //发布时间
    recommend: "checked",
    addTime: "2020/01/08 18:00:00",
    uploadedBy: "喻志超",
    displayStatus: "显示",
    remarks: "备注内容35",
  },
];
var page3 = 1;
//每页数据条数
var count3 = 10;
var oDrugReview = document.querySelector(".drugReview");
//获取tbody
var oReviewTbody = document.querySelector(".drugReview-tbody");
//获取分页容器
var oReviewPagination = document.querySelector(".reviewPagination");
//获取上一页的按钮
var oReviewPrevBtn = document.querySelector(".review-prev");
//获取下一页的按钮
var oReviewNextBtn = document.querySelector(".review-next");
//获取页脚容器
var oReviewFooterBox = document.querySelector(".review-footerBox");
//获取批量删除按钮
var oReviewDelAll = document.querySelector(".review-delAll");
//获取全选按钮
var oReviewSelAll = document.querySelector(".review-selectAll");
var a = 0;
//获取筛选输入框按钮
var oReviewSearchInp = document.querySelector(".review-searchInp");
//获取筛选框1按钮
var oReviewSelect1 = document.querySelector("#review-select1");
//获取筛选框2按钮
var oReviewSelect2 = document.querySelector("#review-select2");
//获取搜索按钮
var oReviewSearchBtn = document.querySelector(".review-selectBtn");
//页面初始化渲染
var oUnaudited = document.querySelector(".drugsStatus-unaudited");
function render3() {
  var reviewStr1 = oReviewSearchInp.value;
  var reviewStr2 = oReviewSelect1.value;
  var reviewStr3 = oReviewSelect2.value;
  var reviewData1 = [];
  var reviewData2 = [];
  var reviewSearchData = [];

  //判断第一个条件搜索
  if (reviewStr1.trim() == "") {
    reviewData1 = auditData;
  } else {
    for (var i = 0; i < auditData.length; i++) {
      if (auditData[i].drugCompanies.includes(reviewStr1)) {
        reviewData1.push(auditData[i]);
      }
    }
  }
  //判断第二个条件搜索
  if (reviewStr2.trim() == "请选择分类") {
    reviewData2 = reviewData1;
  } else {
    for (var i = 0; i < reviewData1.length; i++) {
      if (reviewData1[i].drugClassification1.includes(reviewStr2)) {
        reviewData2.push(reviewData1[i]);
      }
    }
  }
  //判断第三个条件搜索
  if (reviewStr3.trim() == "请选择分类") {
    reviewSearchData = reviewData2;
  } else {
    for (var i = 0; i < reviewData2.length; i++) {
      if (reviewData2[i].drugClassification2.includes(reviewStr3)) {
        reviewSearchData.push(reviewData2[i]);
      }
    }
  }
  //让tbody为空
  oReviewTbody.innerHTML = "";
  //根据count和page渲染数据
  var reviewRenderArr = reviewSearchData.slice(
    (page3 - 1) * count3,
    page3 * count3
  );
  //循环要渲染的数据
  for (var i = 0; i < reviewRenderArr.length; i++) {
    //创建tr
    var oTr = document.createElement("tr");
    //给创建内容
    oTr.innerHTML = `<td>
    <input
      type="checkbox"
      class="reviewIdJudge"
      value="${reviewRenderArr[i].id}"
    />
</td>
<td>${reviewRenderArr[i].drugName}</td>
<td>
<img
  src="${reviewRenderArr[i].src}"
  alt=""
/>
</td>
<td>${reviewRenderArr[i].price}</td>
<td>
  ${reviewRenderArr[i].sell}
</td>
<td><span class="statusJudge">${reviewRenderArr[i].status}</span></td>
<td>${reviewRenderArr[i].stock}</td>
<td>${reviewRenderArr[i].releaseTime}</td>
<td>
<a class="review-see">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
<a class="review-check">审核</a>&nbsp;&nbsp;&nbsp;&nbsp;
</td>`;
    //把tr插入tbody里面
    oReviewTbody.appendChild(oTr);
  }

  //渲染页码
  //找到所有的1，2，3，4的页码
  var aReviewPageBtn = document.querySelectorAll(".review-pageBtn");
  //删除所有的页码
  for (var i = 0; i < aReviewPageBtn.length; i++) {
    oReviewPagination.removeChild(aReviewPageBtn[i].parentNode);
  }
  //根据数据的长度重新创建页码
  for (var i = 1; i <= Math.ceil(reviewSearchData.length / count3); i++) {
    //创建li
    var oLi = document.createElement("li");
    //给li创建内容
    oLi.innerHTML = `<a class="review-pageBtn" href="#">${i}</a>`;
    //如果li和当前的页码一致，给他加一个选中的class
    if (i == page3) {
      oLi.classList.add("active");
    }
    //在下一页的前面插入页码
    oReviewPagination.insertBefore(oLi, oReviewPagination.lastElementChild);
  }

  //渲染页脚
  oReviewFooterBox.innerHTML = "";
  var oSpanFooter = document.createElement("span");
  oSpanFooter.innerHTML = `共${Math.ceil(reviewSearchData.length / count3)}页/${
    reviewSearchData.length
  }条数据`;
  oReviewFooterBox.appendChild(oSpanFooter);
}
render3();

//给分页加事件
oReviewPagination.addEventListener("click", reviewChangePage);
function reviewChangePage() {
  if (event.target.className == "review-pageBtn") {
    //修改page
    page3 = event.target.innerHTML;
    //渲染table，渲染分页
    render3();
    oReviewSelAll.checked = false;
    a = 0;
  }
}

//给上一页和下一页加事件
oReviewPrevBtn.addEventListener("click", reviewPrev);
oReviewNextBtn.addEventListener("click", reviewNext);
function reviewPrev() {
  if (page3 > 1) {
    page3--;
    render3();
    oReviewSelAll.checked = false;
    a = 0;
  }
}
function reviewNext() {
  if (page3 < Math.ceil(auditData.length / count3)) {
    page3++;
    render3();
    oReviewSelAll.checked = false;
    a = 0;
  }
}

//批量删除
oReviewDelAll.addEventListener("click", reviewDelAllFn);
function reviewDelAllFn() {
  if (event.target.className == "review-delAll") {
    var reviewDelArr = [];
    var aReviewIdJudge = document.querySelectorAll(".reviewIdJudge");
    //判断所有选择项勾没勾选，把勾选的数据存进新数组delArr
    for (var i = 0; i < aReviewIdJudge.length; i++) {
      if (aReviewIdJudge[i].checked == true) {
        reviewDelArr.push(aReviewIdJudge[i].value);
      }
    }
  }
  //双重for循环，删除对应id数据。
  if (reviewDelArr.length == 0) {
    $("#delAllFailModal").modal("show");
  } else {
    for (var i = 0; i < reviewDelArr.length; i++) {
      for (var j = 0; j < auditData.length; j++) {
        if (reviewDelArr[i] == auditData[j].id) {
          auditData.splice(j, 1);
        }
      }
    }
    render3();
    oReviewSelAll.checked = false;
    a = 0;
    $("#delAllModal").modal("show");
  }
}

//全选
oReviewSelAll.onclick = function () {
  var aReviewIdJudge = document.querySelectorAll(".reviewIdJudge");
  if (oReviewSelAll.checked == true) {
    for (var i = 0; i < aReviewIdJudge.length; i++) {
      aReviewIdJudge[i].checked = true;
    }
    a = aReviewIdJudge.length;
  } else {
    for (var i = 0; i < aReviewIdJudge.length; i++) {
      aReviewIdJudge[i].checked = false;
    }
  }
  a = 0;
};

//联动全选
oReviewTbody.addEventListener("click", reviewSelectFn);
function reviewSelectFn() {
  var aReviewIdJudge = document.querySelectorAll(".reviewIdJudge");
  if (event.target.className.includes("reviewIdJudge")) {
    if (event.target.checked == true) {
      a++;
    } else {
      a--;
    }
    if (a == aReviewIdJudge.length) {
      oReviewSelAll.checked = true;
    } else {
      oReviewSelAll.checked = false;
    }
  }
}

//筛选框选项关联
oReviewSelect1.addEventListener("click", reviewSelect1Fn);
function reviewSelect1Fn() {
  switch (event.target.value) {
    case "请选择分类":
      oReviewSelect2.innerHTML = `
            <option selected="selected" value="请选择分类">请选择分类</option>
      <option class="part1" value="钙通道阻滞用药">钙通道阻滞用药</option>
      <option class="part1" value="慢性心功能不全">慢性心功能不全</option>
      <option class="part1" value="抗心律失常药">抗心律失常药</option>
      <option class="part2" value="镇咳药">镇咳药</option>
      <option class="part2" value="祛痰药">祛痰药</option>
      <option class="part2" value="平喘药">平喘药</option>
      <option class="part3" value="止痒药">止痒药</option>
      <option class="part3" value="消炎药">消炎药</option>
      <option class="part3" value="过敏药">过敏药</option>`;
      break;
    case "心血管系统用药":
      oReviewSelect2.innerHTML = `<option selected="selected" value="请选择分类">请选择分类</option>
      <option class="part1" value="钙通道阻滞用药">钙通道阻滞用药</option>
      <option class="part1" value="慢性心功能不全">慢性心功能不全</option>
      <option class="part1" value="抗心律失常药">抗心律失常药</option>`;
      break;
    case "呼吸系统用药":
      oReviewSelect2.innerHTML = `<option selected="selected" value="请选择分类">请选择分类</option>
            <option class="part2" value="镇咳药">镇咳药</option>
      <option class="part2" value="祛痰药">祛痰药</option>
      <option class="part2" value="平喘药">平喘药</option>`;
      break;
    case "皮肤科用药":
      oReviewSelect2.innerHTML = `<option selected="selected" value="请选择分类">请选择分类</option>
            <option class="part3" value="止痒药">止痒药</option>
      <option class="part3" value="消炎药">消炎药</option>
      <option class="part3" value="过敏药">过敏药</option>`;
      break;
  }
}

// 筛选
oReviewSearchBtn.addEventListener("click", reviewSearchFn);
function reviewSearchFn() {
  page3 = 1;
  render3();
}

//查看
oReviewTbody.addEventListener("click", reviewCheckFn);
function reviewCheckFn() {
  // 查看页面显示
  if (event.target.className.includes("review-see")) {
    oDrugReview.classList.remove("active2");
    var reviewArr = [];
    var reviewId =
      event.target.parentNode.parentNode.children[0].children[0].value;
    for (var i = 0; i < auditData.length; i++) {
      if (auditData[i].id == reviewId) {
        reviewArr.push(auditData[i]);
      }
    }
    oUnaudited.style.display = "block";
    oStatusSuccessTbody.innerHTML = ` <tr class="tr1">
      <td rowspan="5" class="drugs-img">
        <img
          src="${reviewArr[0].src}"
          alt=""
        />
      </td>
      <td class="active td1">ID</td>
      <td class="td2">${reviewArr[0].id}</td>
      <td class="active td3">药品名称</td>
      <td class="td4">${reviewArr[0].drugName}</td>
      </tr>
      <tr class="tr2">
      <td class="active">规格</td>
      <td>${reviewArr[0].Specification}</td>
      <td class="active">价格</td>
      <td>￥${reviewArr[0].price}</td>
      </tr>
      <tr class="tr3">
      <td class="active">药企</td>
      <td>${reviewArr[0].drugCompanies}</td>
      <td class="active">库存</td>
      <td>${reviewArr[0].stock}</td>
      </tr>
      <tr class="tr4">
      <td class="active">是否为处方药</td>
      <td>${reviewArr[0].prescription}</td>
      <td class="active">药品分类</td>
      <td>${reviewArr[0].drugClassification1}>${reviewArr[0].drugClassification2}</td>
      </tr>
      <tr tr class="tr5">
      <td class="active">发布时间</td>
      <td>${reviewArr[0].releaseTime}</td>
      <td class="active">状态</td>
      <td>${reviewArr[0].status}</td>
      </tr>
      `;
  }
}
